//
//  receiveVersion.m
//  tcpoctest
//
//  Created by gump on 5/14/13.
//  Copyright (c) 2013 gump. All rights reserved.
//

#import "receiveVersion.h"

#import "VersionDataSource.h"

@implementation receiveVersion

-(void)processreceive
{
    //返回 88char(1)，Xchar(1), 版本号长度int,
    //版本号char(x), 版本描述长度int,版本描述char(x),
    //版本url长度int,版本url char(x)
    int vp = [logicsb ReadChar];//read version type
    if (vp == VT_IOS)
    {
        int l = [logicsb ReadIntWithTT:NTT_BIG2SMALL];
        NSString *strvernum = [logicsb ReadStringWithLength:l];
        
        if (![strvernum isEqualToString:VERSION_STRING]) {
            l = [logicsb ReadIntWithTT:NTT_BIG2SMALL];
            [[DataControl shareControl].verDS SetContent:[logicsb ReadStringWithLength:l]];
            
            l = [logicsb ReadIntWithTT:NTT_BIG2SMALL];
            [[DataControl shareControl].verDS SetUrl:[logicsb ReadStringWithLength:l]];
            
            [[DataControl shareControl].UICommendDS addUICommand:UC_ALERTVERSION];
        }
    }
    
    [self ShowLog];
}

@end
